package com.hegongda.okcmall.product.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author liueidong
 * @create 2021-03-06 16:14
 */
@Configuration
public class RedissonConfig {

    // redisson的单节点进行配置
    @Bean
    public RedissonClient redissonClient(){
        // 默认连接地址 127.0.0.1:6379
        Config config = new Config();
        config.useSingleServer().setAddress("redis://192.168.175.131:6379");
        return Redisson.create(config);
    }

}
